//
// Created by yyl on 2018/6/5.
//


#include "../yyl_log.h"

extern "C" {
#include "libavformat/avformat.h"
}
extern "C"
JNIEXPORT jstring JNICALL
Java_com_yyl_jni_MyVideo_getVersion(JNIEnv *env, jobject instance) {
    std::string hello = "Hello from ffmpeg";
    for (int i = 0; i < 5; ++i) {
        LOGI("++i= %d", i)
    }
    for (int i = 0; i < 5; i++) {
        LOGI("i++=  %d", i)
    }
    return env->NewStringUTF(hello.c_str());
}
extern "C"
JNIEXPORT jint JNICALL
Java_com_yyl_jni_MyVideo_setFFmpeg(JNIEnv *env, jobject instance) {
    av_register_all();
    AVCodec *c_temp = av_codec_next(NULL);
//    while (c_temp != NULL) {
//        switch (c_temp->type) {
//            case AVMEDIA_TYPE_VIDEO:
//                LOGI("Video %s", c_temp->name);
//                break;
//        }
//        c_temp = c_temp->next;
//    }



    return 0;
}